package com.learn.repository;

import com.learn.entity.AdminEntity;
import com.learn.entity.RoleEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface RoleRepository extends JpaRepository<RoleEntity, Integer>{
    @Query("select a from RoleEntity a where a.id = :id")
    RoleEntity findById(@Param("id") int id);

    @Query("select a from RoleEntity a where a.id in (:ids)")
    List<RoleEntity> findByIds(@Param("ids") Integer[] ids);
}
